<div class="navbar navbar-fixed-top" role="navigation">
    <div class="main-nav">
        <!-- Collapsed navigation -->
        <div class="navbar-header">
            <a class="navbar-brand" href="{{ nav.homepage.url }}">
                <!--{{ config.site_name }}-->
                <img src="{{ base_url }}/img/logo.png" alt="">
            </a>
        </div>

        <!-- Expanded navigation -->
        <div class="navbar-collapse collapse">

          <ul class="nav navbar-nav">
            {% for menu in nav %}
              <li class="pull-left{% if menu.active %} active{% endif %}">
                {% if menu.children %}
					<!--<a href="{{ menu.children[0].url }}">{{ menu.title }}</a>-->
					<li class="dropdown{% if menu.active %} active{% endif %}">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">{{ menu.title }} <b class="caret"></b></a>
                        <ul class="dropdown-menu">
                        {%- for nav_item in menu.children %}
                            {% if nav_item.children %}
								<li {% if nav_item.active %}class="active"{% endif %}>
									<a href="{{ nav_item.children[0].url }}">{{ nav_item.title }}</a>
                                </li>
                            {% else %}
                                <li {% if nav_item.active %}class="active"{% endif %}>
                                    <a href="{{ nav_item.url }}">{{ nav_item.title }}</a>
                                </li>
							{% endif %}
                        {%- endfor %}
                        </ul>
                    </li>
                {% else %}
					<a href="{{ menu.url }}">{{ menu.title }}</a>
                {% endif %}
              </li>
            {% endfor %}
              <li>
                  <a href="https://www.bmob.cn/repository/index" target="_blank">知识库</a>
              </li>
              <li>
                  <a href="http://doc.bmob.cn/video/index.html" target="_blank">视频教程</a>
              </li>
            </ul>

            
              {%- block search_button %}
                {%- if 'search' in config['plugins'] %}
                <ul class="nav navbar-nav navbar-right"></ul>
                <li>
                    <a href="#" data-toggle="modal" data-target="#mkdocs_search_modal">
                        <i class="fa fa-search"></i> 搜索
                    </a>
                </li>
                </ul>
                {%- endif %}
              {%- endblock %}
            
        </div>
    </div>
</div>
